package com.yywz.observerpattern;

import java.util.Observable;
import java.util.Observer;

public class Watcher implements Observer {
	
	public Watcher(Watched w){
		w.addObserver(this);
	}
	
	@Override
	public void update(Observable o, Object arg) {
		System.out.println("Data changed: " + ((Watched)o).retrieveData());
	}

}
